Main simulation results for MEPS paper, from fitting maximum likelihood value (and confidence interval) of \(b\) for each combination of 10,000 simulated data sets, four binning methods and two fitting methods (MLEmid or MLEbin). Reproduces MEPS Figures 4 and 5 and Table S.3. Then does the same analyses with \(x\)min\(=16\) (Figures S.35 and S.36 and Table S.4), and with \(x\)min\(=1\) but only sampling above a cutoff value of 16 (Figures S.37 and S.38 and Table S.5).
The simulated data take over an hour (on a fast laptop) to generate, bin and fit. So results are saved within the package in the lists MLEbin.MEPS.default
, MLEbin.MEPS.xmin16
and MLEbin.MEPS.cutoff16
. Each list contains the fitted maximum likelihood value (and confidence interval) of \(b\) for each combination of 10,000 simulated data sets, four binning methods and two fitting methods (MLEmid or MLEbin).
To create MLEbin.MEPS.default
run the next line (which is not evaluated by this vignette but is run once in data-raw/simulate-data2.R
to save the list as part of this package):
The list contains three items (see ?MLEbin.simulate
):
summary(MLEbin.MEPS.default)
#> Length Class Mode
#> MLE.array 80000 -none- numeric
#> MLEconf.array 160000 -none- numeric
#> MLE.array.parameters 8 -none- list
dim(MLEbin.MEPS.default$MLE.array)
#> [1] 10000 4 2
with example MLEs of \(b\):
MLEbin.MEPS.default$MLE.array[ 1:5, , ]
#> , , MLEmid
#>
#> Linear 1 Linear 5 Linear 10 2k
#> 1 -1.962223 -1.602415 -1.387698 -1.930025
#> 2 -1.922912 -1.612462 -1.422687 -1.888848
#> 3 -1.928393 -1.608458 -1.404385 -1.895439
#> 4 -1.899897 -1.603086 -1.421272 -1.871270
#> 5 -1.918810 -1.615979 -1.423418 -1.882925
#>
#> , , MLEbin
#>
#> Linear 1 Linear 5 Linear 10 2k
#> 1 -2.027802 -2.016010 -1.988496 -2.035029
#> 2 -1.977726 -1.983818 -1.980087 -1.980062
#> 3 -1.985058 -2.004248 -1.980208 -1.988166
#> 4 -1.950456 -1.945134 -1.940336 -1.958560
#> 5 -1.971887 -1.995501 -1.980947 -1.972799
Example confidence intervals are
MLEbin.MEPS.default$MLEconf.array[1:5, "Linear 1", "MLEmid", ]
#> confMin confMax
#> 1 -2.026223 -1.901223
#> 2 -1.982912 -1.864912
#> 3 -1.989393 -1.869393
#> 4 -1.958897 -1.842897
#> 5 -1.978810 -1.860810
and the associated parameter values and binning types used for the simulations are:
MLEbin.MEPS.default$MLE.array.parameters
#> $n
#> [1] 1000
#>
#> $b.known
#> [1] -2
#>
#> $xmin.known
#> [1] 1
#>
#> $xmax.known
#> [1] 1000
#>
#> $num.reps
#> [1] 10000
#>
#> $binType
#> $binType[[1]]
#> [1] 1
#>
#> $binType[[2]]
#> [1] 5
#>
#> $binType[[3]]
#> [1] 10
#>
#> $binType[[4]]
#> [1] "2k"
#>
#>
#> $binTypes
#> [1] 4
#>
#> $binType.name
#> $binType.name[[1]]
#> [1] "Linear 1"
#>
#> $binType.name[[2]]
#> [1] "Linear 5"
#>
#> $binType.name[[3]]
#> [1] "Linear 10"
#>
#> $binType.name[[4]]
#> [1] "2k"
Figure 4 shows histograms of the estimates of \(b\) for the MLEs for both methods and all four binning types:
Figure 5 gives the confidence intervals for the MLEs for both methods and all four binning types:
# These two lines just give a different inset for panel (e):
insetMat = matrix(rep(c(-0.01, -0.04), 4),
ncol=2,
byrow=TRUE)
insetMat[3, 1] = 0.3
MLEmid.MLEbin.conf(MLEbin.MEPS.default,
insetMat = insetMat)
Make a dataframe of the results and show here, reproducing Table S.3:
Binning.type | Method | Quantile.5 | Median | Mean | Quantile.95 | Percent.below.true |
---|---|---|---|---|---|---|
Linear 1 | MLEmid | -1.98 | -1.94 | -1.94 | -1.89 | 1 |
Linear 1 | MLEbin | -2.05 | -1.99 | -1.99 | -1.94 | 43 |
Linear 5 | MLEmid | -1.63 | -1.61 | -1.6 | -1.57 | 0 |
Linear 5 | MLEbin | -2.06 | -1.99 | -1.99 | -1.94 | 42 |
Linear 10 | MLEmid | -1.43 | -1.41 | -1.4 | -1.35 | 0 |
Linear 10 | MLEbin | -2.06 | -1.99 | -1.99 | -1.93 | 42 |
2k | MLEmid | -1.95 | -1.9 | -1.9 | -1.86 | 0 |
2k | MLEbin | -2.05 | -2 | -2 | -1.94 | 47 |
Similarly, the simulation results obtained from setting \(x\)min\(=16\) are saved in the object MLEbin.MEPS.xmin16
, obtained by running the next line (which is not evaluated by this vignette but is run once in data-raw/simulate-data2.R
):
Figure S.35 is then
Figure S.36 shows the confidence intervals:
And Table S.4 is:
Binning.type | Method | Quantile.5 | Median | Mean | Quantile.95 | Percent.below.true |
---|---|---|---|---|---|---|
Linear 1 | MLEmid | -2.06 | -1.99 | -2 | -1.94 | 44 |
Linear 1 | MLEbin | -2.06 | -1.99 | -2 | -1.94 | 45 |
Linear 5 | MLEmid | -2.05 | -1.99 | -1.99 | -1.93 | 36 |
Linear 5 | MLEbin | -2.06 | -1.99 | -2 | -1.94 | 45 |
Linear 10 | MLEmid | -2.02 | -1.96 | -1.96 | -1.9 | 14 |
Linear 10 | MLEbin | -2.06 | -2 | -2 | -1.94 | 45 |
2k | MLEmid | -1.93 | -1.87 | -1.87 | -1.82 | 0 |
2k | MLEbin | -2.07 | -2 | -2 | -1.94 | 51 |
Similarly, the simulation results obtained from setting \(x\)min\(=1\) again but only sampling above the cutoff value of 16 are saved in the object MLEbin.MEPS.cutoff16
, obtained by running the next line (which is not evaluated by this vignette but is run once in data-raw/simulate-data2.R
):
Figure S.37 is then
Figure S.38 shows the confidence intervals:
And Table S.5 is:
Binning.type | Method | Quantile.5 | Median | Mean | Quantile.95 | Percent.below.true |
---|---|---|---|---|---|---|
Linear 1 | MLEmid | -2.06 | -1.99 | -2 | -1.93 | 45 |
Linear 1 | MLEbin | -2.06 | -1.99 | -2 | -1.94 | 45 |
Linear 5 | MLEmid | -2.05 | -1.99 | -1.99 | -1.93 | 36 |
Linear 5 | MLEbin | -2.06 | -2 | -2 | -1.94 | 45 |
Linear 10 | MLEmid | -2.02 | -1.96 | -1.96 | -1.9 | 13 |
Linear 10 | MLEbin | -2.06 | -2 | -2 | -1.93 | 46 |
2k | MLEmid | -1.93 | -1.87 | -1.87 | -1.82 | 0 |
2k | MLEbin | -2.07 | -2 | -2 | -1.94 | 51 |